﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.Options;
using Tsual.DataPipeline;
using Tsual.DataPipeline.AspCore;
using Tsual.DataPipeline.Redis;
using Tsual.DataPipeline.Http;
using System.Net.Http;
using System.Net;
using Newtonsoft.Json;
using Tsual.Wechat.Message.Impl;
using System.Threading.Tasks;
using Tsual.Wechat.Cache;
using RedLockNet.SERedis;
using StackExchange.Redis;

namespace Tsual.Wechat.Pipes
{
    public class RedisWriteonlyExpirableStringPipe<TMeta> : RedisExpirableStringPipe<TMeta>
        where TMeta : IConvertible<string>, IConvertible<LockType>
    {
        public RedisWriteonlyExpirableStringPipe(IDatabase cache, RedLockFactory lockFactory) : base(cache, lockFactory)
        {
        }

        public override bool CanRead(TMeta meta) => false;
    }

    public class RedisWriteonlyHashPipe<TMeta> : RedisHashPipe<TMeta>
        where TMeta : IConvertible<KeyValuePair<string, string>>, IConvertible<LockType>
    {
        public RedisWriteonlyHashPipe(IDatabase cache, RedLockFactory lockFactory) : base(cache, lockFactory)
        {
        }
        public override bool CanRead(TMeta meta)
        {
            return false;
        }
    }
}
